package com.mew.common.dc.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mew.common.entity.user.ThirdUser;
import com.mew.common.entity.user.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@DS("mew_core")
public interface ThirdUserMapper extends BaseMapper<ThirdUser> {

    @Select("SELECT u_user.*, u_game_id.gid FROM u_user, u_game_id, u_third_user " +
            "WHERE u_third_user.third_id=#{thirdId} and u_third_user.user_type=#{type} " +
            "and u_third_user.id=u_user.id and u_user.id=u_game_id.id")
    public User getThirdUser(@Param("thirdId") String thirdId, @Param("type") byte type);
}
